package cn.xorange.commons.system.entity.system;

import cn.xorange.commons.data.annotation.MColumn;
import cn.xorange.commons.data.annotation.MTable;
import cn.xorange.commons.data.constants.KeyType;
import cn.xorange.commons.data.core.entity.DataEntity;
import cn.xorange.commons.utils.validate.MValidate;
import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;

/**
 * @author YangJian
 */
@Data
@MTable(owner = "kf_ida",name = "用户表",logicDel = true)
public class SysUser extends DataEntity {

    @MColumn(key = KeyType.AUTO)
    private Long userId;
    @MColumn
    @MValidate(max = 20)
    private String staffId;
    @JSONField(serialize = false)
    @MColumn
    private String password;
    @MColumn
    @MValidate(min = 2,max = 12)
    private String username;
    @MColumn
    @MValidate(max = 30)
    private String nickname;
    @MColumn()
    private Integer orgId;
    private String orgName;

    @MColumn(name = "身份证")
    @MValidate(repeatSearch = {"identity"})
    private String identity;
    @MColumn(name = "手机号码")
    @MValidate(repeatSearch = {"phone"})
    private String phone;
    @MColumn(name = "email")
    @MValidate(repeatSearch = {"email"})
    private String email;
    @MColumn()
    private String sex;
    @MColumn()
    private String avatar;
    /** 帐号状态（0正常 1停用） */
    @MColumn()
    private String status;

    private Long tenantId;
    private String tenantName;

}
